-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pattern Inserter: Fix unintended preview panel display when hovering mouse over pattern #47693
Conversation
…mouse over pattern
Size Change: +10 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in 4f45b41. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4075245693
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @t-haman. This fixes the issue.
I just cherry-picked this PR to the release/15.1 branch to get it included in the next release: 5b498c5 |
Fixed regression that occurred with #47316
See this comment: #47316 (comment)
What?
This PR fixes a problem where an unintended block preview panel appears behind you when you mouse over any of the patterns from the pattern inserter.
Why?
In #47316, changed to call
onHover
to display the insertion indicator when mouse over a pattern. This updates thehoverdItem
state and causes the preview panel to appear unintentionally in the following locations:gutenberg/packages/block-editor/src/components/inserter/menu.js
Lines 292 to 294 in c9507b0
How?
Added
onHoverPattern
separately fromonHover
to avoid updating thehoveredItem
. Ideally, it might be better to control the other condition,showInserterHelpPanel
. However, since this property is passed from a upper component, I thought it may be difficult to control using this variable.Testing Instructions
Before
before.mp4
After
after.mp4